/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function enviar_indice(id_de_opcion,id_contenedor,pagina,marco)
{
	var Request = false
	if (window.XMLHttpRequest)
	{
		Request = new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		try
		{
				Request = new ActiveXObject("Msxml2.XMLHTTP")
		}
		catch (e)
		{
			try
			{
				Request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e)
			{
			}
		}
	}
	else
	{
		return false
	}
	Request.onreadystatechange=function()
	{
		cargarpagina(Request, id_contenedor,marco)
	}
	Request.open('POST',pagina, true)
	Request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	Request.send(id_de_opcion)
}

function cargarpagina(Request, id_contenedor,marco)
{
	if (Request.readyState == 4 && (Request.status==200 || window.location.href.indexOf("http")==-1))
	{

			document.getElementById(id_contenedor).innerHTML=Request.responseText
			//window.parent.frames[marco].document.getElementById(id_contenedor).innerHTML=Request.responseText



	}
}


function cargar_datos(url_fuente,id_cambio,parametros) {
        var url = encodeURIComponent(url_fuente);
        var params = parametros;

        new Ajax.Request(url, {
        method: 'post',
        parameters: params,
        asynchronous: true,
        onSuccess: function(transport) {

        if(transport.responseText.length > 0){
                document.getElementById(id_cambio).innerHTML=transport.responseText;
        }}});
}




